package com.xinan.dmgl.cggl;

import com.jfinal.ext.plugin.tablebind.TableBind;
import com.jfinal.kit.StringKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;

import java.sql.Timestamp;
import java.util.List;
import java.sql.Date;

@TableBind(tableName = "cpgl_rk")
public class CpglRk extends Model<CpglRk>{
    public static final CpglRk dao = new CpglRk();

    //columns START
    private String ID = "id";  //
    private String WPID = "wpid";  //物品id
    private String WPMC = "wpmc";  //wpmc
    private String JYSJ = "jysj";  //建议售价
    private String CTYF = "ctyf";  //长途运费
    private String DTYF = "dtyf";  //短途运费
    private String WPSL = "wpsl";  //物品数量
    private String JHCJ = "jhcj";  //进货厂家
    private String CJDH = "cjdh";  //厂家电话
    private String CJWX = "cjwx";  //厂家微信
    private String CJQQ = "cjqq";  //厂家qq
    private String JHJG = "jhjg";  //总价
    private String LLRYDM = "llrydm";  //录入人
    private String LRRQ = "lrrq";  //录入电话
    private String JHCJID="jhcjid";
    private String YXBZ="yxbz";

    public void setId(int value) {
        set(ID, value);
    }

	public int getId() {
		return get(ID);
	}
    public void setWpid(String value) {
        set(WPID, value);
    }

	public String getWpid() {
		return get(WPID);
	}
    public void setWpmc(String value) {
        set(WPMC, value);
    }

	public String getWpmc() {
		return get(WPMC);
	}
    public void setJysj(String value) {
        set(JYSJ, value);
    }

	public String getJysj() {
		return get(JYSJ);
	}
    public void setCtyf(String value) {
        set(CTYF, value);
    }

	public String getCtyf() {
		return get(CTYF);
	}
    public void setDtyf(String value) {
        set(DTYF, value);
    }

	public String getDtyf() {
		return get(DTYF);
	}
    public void setWpsl(String value) {
        set(WPSL, value);
    }

	public String getWpsl() {
		return get(WPSL);
	}
    public void setJhcj(String value) {
        set(JHCJ, value);
    }

	public String getJhcj() {
		return get(JHCJ);
	}
    public void setCjdh(String value) {
        set(CJDH, value);
    }

	public String getCjdh() {
		return get(CJDH);
	}
    public void setCjwx(String value) {
        set(CJWX, value);
    }

	public String getCjwx() {
		return get(CJWX);
	}
    public void setCjqq(String value) {
        set(CJQQ, value);
    }

	public String getCjqq() {
		return get(CJQQ);
	}
    public void setJhjg(String value) {
        set(JHJG, value);
    }

	public String getJhjg() {
		return get(JHJG);
	}
    public void setLlrydm(String value) {
        set(LLRYDM, value);
    }

	public String getLlrydm() {
		return get(LLRYDM);
	}
    public void setLrrq(Date value) {
        set(LRRQ, value);
    }

	public Date getLrrq() {
		return get(LRRQ);
	}
	//columns END

    public List<CpglRk> findAll() {
        return find("select * from cpgl_rk");
    }
    public String getJHCJID() {
		return JHCJID;
	}

	public void setJHCJID(String jHCJID) {
		JHCJID = jHCJID;
	}
	

	public String getYXBZ() {
		return YXBZ;
	}

	public void setYXBZ(String yXBZ) {
		YXBZ = yXBZ;
	}
    /**
     * @param   where
     * @return  Record
     */
    public List<Record> findAlls(String where) {
        String sqlExp = " from cpgl_rk";
        if(StringKit.notBlank(where)){
                sqlExp += " where " + where;
        }
                return Db.find( "select *,(select cnname from auth_user where username=llrydm) as lrrmc " +sqlExp );

    }

    public Page<CpglRk> page(int pageNumber, int pageSize, String where) {
        String sqlExp = "from cpgl_rk";
        if(StringKit.notBlank(where)){
            sqlExp += " where " + where;
        }
        return paginate(pageNumber, pageSize, "select *,(select cnname from auth_user where username=llrydm) as lrrmc ", sqlExp);
    }
    public Page<CpglRk> pagetj(int pageNumber, int pageSize, String where) {
        String sqlExp = "from cpgl_rk";
        if(StringKit.notBlank(where)){
            sqlExp += " where " + where;
        }
        return paginate(pageNumber, pageSize, "select *,(select cnname from auth_user where username=llrydm) as lrrmc ", sqlExp);
    }


	
}

